﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Milan.Diagnostics
{
	/// <summary>
	/// Logs are by company name.  Each company has one LogServer.
	/// </summary>
	public class LogClient : Milan.Net.RpcClient, ILog
	{
		public LogClient()
			: base(GetPipeName(), 10000)
		{
		}
		public static string GetPipeName()
		{
			return "\\log." + Settings.CompanyName;
		}
		public void Write(string message, LogLevel logLevel)
		{
			Transact(logLevel.ToString() + ":" + message);
		}
		public void WriteLine(string line, LogLevel logLevel)
		{
			Transact(logLevel.ToString() + ":" + line + '\n');
		}
	}
}
